removed authentication duplication and cleanup