refactor checkings