Removed some repetitive code