Some refactroings