oo structure, fix startup bug