refactors

I'm sorry this isn't a better refactor. Was really impressed with code.