smartcards code added and organized
some removals