add temporary folder with codec and code refactoring