refactoring for more fine grained responsibilities