more refactoring for new style