Refactor deployment

Following refactoring ruby edition's replace temp w/ query