updated headers for UI and cleaned up code