Refactor model extension code
Remove binary stack classes