Refactored, but still doesn't work... :-(