Refactored listener context initialozation