Refactor format functions and use fanci to rename JSON