Refactored the CRAP out of this project.