src/core: got rid of some global variables
!BUGFIX