trying to refactor