Make devise more engine friendly

DO NOT MERGE

This is here to give a reference on the current set of changes.