Save memory by only defining these methods once
Merge pull request #286 from candy-chat/feature/save_memory

Save memory by only defining these methods once