refactoring, putting common methods into one file
refactoring