code cleanup, wonder if it still works...