some cleanup, fill function