merge two list types to one function