additional refactoring and code review [KFSQA-832]