more refactoring/refining