Refactored DB actions