Re-factored to allow for more upgrades