code cleanup mostly