Big Refactor + validation + first test