move lookup table away from logic
split import function in two
remove a bit more repetition