Flux Layout - code refactoring

Tidy up code and output.