Trying to modularize the python sources a bit