Adapted code to comply with codestyle