Refactor for more meta-data driven approach.