Refactor (split into several files)