Refactor it abit