Refactor for consistency, smaller functions