less repetition in code