file structure and dist generation refactored