Structural and mechanistic investigation of enzyme-catalysed phosphoryl transfer in two HAD superfamily proteins