home JS code cleanup