refining the design using java interfaces