reduce some code