Refactored version ready for deploy