Removed an instance of spaghetti code