Framework for generalized polytropes with complexity factor