Implementing a more general Item class