Reorder code
Use haddock format