streamline the code