move some logic to places where it should belong. changes names for switching to proper name conventions