Remove unused methods and close DB after use