refactoring metadata generator component