Enclose challenge creating codes

This makes it easier to maintain codes.