some optimazation
a little pretier