Added Constants, removed unused code and added runOnUIThread for stuff that needs to run on UI thread