Refactor a bit"