These checks are just straight up dumb, but at least there's no magic numbers now (really need to fix all this up though).