adding support for file copy and refactoring folder copy