Some other minor optimization & cleanup