first part of code cleanup
Second part of code cleanup
part three of code cleanup