switch from instance to local variables

fix #7