Code cleanup and preparing for new adapters