Remove deprecated API usage, code cleanup