Separate chapter functions from main file.