more tests and cleanup
rename reference -> variable