update: more refactoring