refactor almost done, close to starting build!