Remove map type
Use pkg func
Move file to pkg