remove needless definitions
fix mixed declarations and codes
add missing const qualifier
include account header
fix pointer qualifier