Add tests for promise immutability
Remove unneeded code