dived processor into more modularized parts