Refactor database and validation helper to be autoloaded