optimize some UI stuff