refactored capifony database tasks