Code clean up. Method scope test added.