Refactor to save size and keep DRY