Code

refactoring: gathering some commonly copy'n'pasted functions on a common