Restructure code for easier including.