Modify spacings
Do some refactorings and add tests