Half done changes: big refactor