Fixed repetitive code