Refactor pelican so it follows new practises