Removed repetitive code