fixed typo
moved some vars to namespace