Updated to streamline code