do some optimazation