A better implementation of the process method