clan changing, code cleanup