adjusting code structure