move monitor related functions into monitor object; next refactor all related functions into objects