Removed unused import and made code nicer.