Using HashMap in those cases is asking for trouble, as some errors may only happen when performing operations in a certain order.