refactoring code into concrete structures