refactoring

cleaned this up a little