first version of refactored format api