separate function from test ion