Swat.
Some refactoring.