Changing the approach plus some refactor