Made slave code super neat and small