Set current directory
Optimize memory usage