[refactor] reworking for better modularity.