More structure changes - remove code duplication and unnecessary conditions