refactor common framework out and use partial application