Conversion to production ready php