reorganize some private methods