refactord schema helper