rewrite with better constructors