The schreier refinement theorem for categories