Cleanup and function visibility changes