Refactored for better sanitization of database inputs