refactor system metadata stuff