Clean up some repetition in codebase