Refactor a bit to be more clear