More cleaning up and tearing apart functions.
More cleaning up and tearing apart functions.