Remove style error of to many assignments in a method