re-factored. removed unused files