refactor objectformatter to typeformatter and param