Improve performance by hash lookup