Expand config, and remove redundant code