move away from callback to exceptions