refactor for cleanliness