Implemented polling consumer, reformated and cleaned code