simplification and cleanup