moved some variables to private