Some of these checks could probably be removed and replaced by if(..()) return