Added refactoring of cilent listener