started slight refactor: splitting code into module/factory files and injecting them instead of massive file of everything.