Refactoring
Remove panic
Add comments (to pass golint)