Added function to split prefix and filename (redundant stuff everywhere)