Format utility class: Code cleanup and minor improvements