refactoring and tests for Processes and KR