Add some declaration and cleanup