some sloppy refactoring
radical refactor completed