extract functions into separate script to be able to reuse from slidify presentation