Move do_caps to a hook
pep8