fix failing tests plus slight refactoring
new line plus formatting