Move estimate into separate function