Use variable variables instead of eval
Avoid code duplication
Use local variable