Cleaned some code. Listeners etc.