Refactor

Un petit debut de refactoring, spa finit.