Moving calculations into services