Extract pressure calc into separate function