removing minor code duplication. etc