Refactor/mysql