Refactor to suit my needs