Before fixed idea issues.
After cleanup code.
Used prepared statements instead statements.
Before refactoring.
Continue testing.
Add some unit tests.