refactor data security