first good refactor