fixed merge conflicts from refactor branch