callback: make them functions; tests