Adapting code structure