[REFS:#308] refactored code