Added a anonymous inner method to promote testing