Starting to refactor a bit..