Isolated fpm cmd generation to ease printing
Major refactoring