merging all refactors from branch to master