Rename 'directory' to 'app_dir' for consistency