Improve in function