refactored code into krober