common F# code