several changes were applied to improve the source code quality