restructurization and current dir tracking