Added icon and cleaned up dialog code