Refactored to use directories