Added commonly used method

@foaly-nr1 

The indentation is totally messed up.