Make callback definitions generic