refactored db custom module