comments + cleanup
remove global var