Simplify directory management

Change-Id: Ibcc0af14f5a12a31f57104258fccf6dd4414ed0d