refactor (removed debug to file snippets)