quick refactoring and clean up