Elements factory is improved. Resources factory is added.