starting to structure js, introduced listener