refactor base and ports databags