removed some more repetitive code