refactor and simplify ecb cracking