Add simple dataBase adapter. Optimize code.