Fix compiling issues do to refactoring