Encapsulated ready() callback into named function