Refactoring done, stuff works now