WIP refactoring and making work with new