modularizing by extracting functions SDK style.