remove extra returns and conditional compilation