Some basic refactoring
Fix merge conflicts