Cleaning up the API so it is properly separated from the UI