optimise the mysql handler a bit
more code improvements
Merge pull request #8 from thijsdezoete/master

optimise the mysql handler a bit