run against self, update makefile.pl
some refactoring pt 1
some refactoring pt 2
some refactoring pt 3
tidy