tests & better constructor functions