Removed some repeat code