refactoring and Format.to_array()