some refactoring regarding previous commit
better actionlistener and cleanup