Refactored a bit and added weblistener