Trying to find the sweet spot for positioning of code