restructuring and actionlisteners