various code consolidations