Reorganize code paths