Big refactoring - fixed private vars and removed duplication of nts()