re-factoring api in and out parameters