Refactored #process method