clean up code for __getitem__ method