cleanup and correct usage of private vars