Clean up variable names, remove redundant logic