raw refactoring

moved most functionality to other class from from