Adding support for files managenment, fixing multiple bugs, refactoring invalid fields