reduced duplication in format_for_views method