heavy refactor for dynamic mybatis configuration