Trying to refactor a bit more