finish a big part of refactoring.. still need to work on small stuff