refactoring bactch processor code