Cleanup (removing using namespace std;) + refactor (internal -> detail)