Small refactoring and removing unused stuff.