refactor into multiple files
add immutable set