simplify
fix database storage encoding