move code in front of return