[FIX] compile fixes

minor restructuring to fix compile warnings