Core: Improve the Core stack management