Initialise dir property and use a getter

Change-Id: Ie228855430c29ac720b56e241801f318b1e979f7