refacted some class