Fix selecting elems by ID

Fix #7
Refactoring