Refactored some code by combining similar fields