Rearrange some methods into logical blocks