Updated core logic