refactoring via meta prog