Last clean up, now its working and ready for some serious DRY refactor.