Moving code to reduce overhead