refactor callbacks array creation.