Fixes #2: Improve code using interfaces