Removed duplicated checks and renamed method to match function