moved some listeners from field attribute to class
some code formatting