fixes build (minor refactorings)