Clean up more code

Break entry writing out into a separate function to allow us to separate it from acquiring the FP in future...