Directory decouple

cleaned up directory.js