Refactor value_representation to use table instead of switch