refactoring, add mysql integration