Improve init and end