simplify and cleanup