Major refactor - move away from refclasses