refactored controller code and added itemizer class in lib