refactoring code
fixed attribution/cc-by-sa problem