Refactored for Docker deployment