Slight change of coding style and some new methods