Few logic changes