Big refactor + mvn fixed