completed refactor
merge from refactor