clean up compound key, enhance tests