simplify and clean up