refactored: simplified, draft version