Moved redirect function to abstract class