small refactoring, optimizations, slide centering