move function def into control class
refactor listeners