fixed formatting and removed superfluous checks