Refactoring; improved file manager