processing functions modularized