Use hash-table to make it more effective