Cleanup code to bring it closer to normal F# practice