refactor and clean up for smaller smells