TODO: more comments wrt. performance