Code refactor in method_missing