refactored format into async func