beginning to refacor to keep code DRY