Monitor: code cleanup