base: refactored base_dir