more code cleanup to make things clean and legible