Removed unused if() and applied a code format