working on the anti-pattern to single responsibility