Generalized core-nilpotent decomposition