Refactored for simplier deployment