Updated with new features like '/dir' operation and divided the methods in different source files