converted things into a class structure