Closes #19: Adds prefender function as well as some more refactoring.