Cleaning up processor.py with helper methods