refactoring

cleaned it up as well as I know how