merge refactor into master