refactor for code cleanliness