remove unnecessary folders, allow null user to be passed