more cleanups, unused variable and functions