refactor formats to external object