Moved processing code to separate class, modified variable types