Refactoring to streamline processor code