refactor code to allow for configuration

I've defined a reader down below, so it seemed to be better to just do `attr_writer` here.