added data support, removed useless code