refactor shipping calculations