Fix an error with order of declaration
Refactor common code => common.pxi