clean code refactor