-Move the detectIfStuck method in the common base Engine
-Reorganize and remove duplicated code