Streamlined code and improved coding style