Removed unnecessary check and minor code styling