refactor to get rid of top_process