1. refactor the code to make it more clean 2. support all value types