sqlite refactored with models for table and columns