Both copy and remove have this very similar (perhaps exactly the same) method. Is there an opportunity for code sharing here, perhaps through multiple inheritance, or through their respective superclasses? It may be possible to just create this function as static, and bind it to these two classes.