Started refactoring of processor algorithm