corrected inheritance
added initial tests for class hierarchy factories