refactoring interfaces.py