Some code cleanup on core project

- add explicit return type to (mainly) publish methods
- remove unnecessary commented debug prints
- some minor improvements (see comments on diff)