implemented message patern, started cleanup