moved many function into mass