Last version
Mainly refactoring