Refactor height and width into dimensions class