refactor to eliminate use of erb etc.