Refactoring
MySQL compatibility