reafctor CAS gateway + clean dependencies