implement handlers. simplify constructors.