move more code to config