Streamlined Code for production use