begin refactor
Fix broken function calls
Fix merge conflict