finishing refactoring, haven't gotten to specs yet