Refactoring the code, better dataset