A generalized framework for improved state estimation in three-phase power grids