Use a protocol to clean up the code