re-factoring/simplifying - in progress