Last refactoring commit

Code should be adaptable enough now