Refactor constructor functions
Change function locations
Refactor hashVal function