removed proprietary stuff and bettered abstraction