Refactor into separate files and parameterize
Fix overlappings