Refactor Consumer to more methods to simplify its logic.