refactored mockwriter and attributewriter as private members which are

initialised in the setup method