add prepend_declaration, fix append_declaration