Add metafiles
Refactor into separate modules