splitting core cpp code and python binding code