Major refactor of mutations lib