Add gen_class_guard to reduce method involation