fixed default root dir value, added factory