add init method
Merge pull request #1 from cbalit/refacto

add init method