little bit of a refactor