CFY-644 refactoring
CFY-644 bug fixes