streamline code and log fixes