Refactorization/engines

`end` at 15, 6 is not aligned with `if` at 8, 23