Improving test code

Removing duplicated classes, moving shared initialization for the parent class