and type to BaseReference