Attempt to refactor