Re-organized the code, to make it easier to add components in the future.