[*] move database helper to outer class
[+] create database manager sigleton
[*] fixed bug with database leaks