added guardian factory and guardian factory tests