Trimming down some code